import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class text01 {
    public static void main(String[] args) throws IOException {
        FileOutputStream fo = new FileOutputStream("./demo.txt");
        fo.write("向文件中写入一个字符串".getBytes(StandardCharsets.UTF_8));
        System.out.println("写入成功");
        fo.close();
    }
}
